package edu.mse.camel.client.session.team;

import org.eclipse.swt.graphics.RGB;


/*package*/class TeamMember implements ITeamMember {
	
	private String name;
	private String email;
	private TEAMMEMBER_STATUS status;
	boolean isFacilitator;
	private RGB color;
	
	public TeamMember(String name, String email, TEAMMEMBER_STATUS status, boolean isFacilitator){
		this.name = name;
		this.email = email;
		this.status = status;
		this.isFacilitator = isFacilitator;
		this.color = new RGB(0,0,0);
	}
	
	public String getName(){
		return name;
	}
	
	public String getEmail(){
		return email;
	}
	
	public TEAMMEMBER_STATUS getStatus(){
		return status;
	}
	
	public String toString(){
		return name;
	}
	
	public boolean isFacilitator(){
		return isFacilitator;
	}

	public void setName(String name){
		this.name = name;
	}
	
	public void setEMail (String eMail){
		this.email = eMail;
	}
	
	public void setStatus (TEAMMEMBER_STATUS status){
		this.status = status;
	}
	
	public void setFacilitator (boolean isFacilitator){
		this.isFacilitator = isFacilitator;
	}
	
	
	public void setColor(RGB color) {
		this.color = color;
	}
	
	public RGB getColor() {
		if (color == null)
			return new RGB(0,0,0);
		else
			return color;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((name == null) ? 0 : name.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		final TeamMember other = (TeamMember) obj;
		if (name == null) {
			if (other.name != null)
				return false;
		} else if (!name.equals(other.name))
			return false;
		return true;
	}
	
}
